package com.zhoutao123.spring.boot.starter;

import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableAutoConfiguration
@EnableConfigurationProperties(SekaConfig.class)
public class SekaConfiguration {

  @Bean
  @ConditionalOnMissingBean(SekaService.class)
  public SekaService sakeService() {
    return content -> {
      if (content == null) {
        return "";
      }
      return content.toUpperCase();
    };
  }
}
